-- CALC_SCATTERED_BOOKS_BONUS

-- 计算散落的书籍奖励（隐藏物件）
return function(user, bonusArg)
    local rand = DungeonM.getRandSeed("SCATTERED_BOOKS") % 100;
    local rand1 = DungeonM.getRandSeed("SCATTERED_BOOKS");

    -- 80%概率：hp或mp + 20
    -- 20%概率：hp或mp + 40
    local attrib;
    if rand < 80 then
        attrib = FormulaM.invoke("FETCH_BY_RAND", { "max_hp", "max_mp", }, rand1);
        return { 2, attrib, 20 };
    else
        attrib = FormulaM.invoke("FETCH_BY_RAND", { "max_hp", "max_mp", }, rand1);
        return { 2, attrib, 40 };
    end
end